Trigger video recording with MediaRecorder

Aim

To record high resolution video with MediaRecorder while tracking the subjects with EthoVision XT.

Prerequisites

You work with analog video cameras. If you work with digital cameras, EthoVision XT and MediaRecorder cannot access the signal from a digital camera simultaneously.

Procedure

1.In the Trial Control Settings, create a condition that must be true in order to trigger video recording.

2.Follow the procedure in External commands to create an External Command action that starts video recording in MediaRecorder.

tip  To visualize batch (*.bat) files, choose Batch files (*.bat; *.cmd) next to File name.

inset_4900249.jpg 

3.Place the second box after the first in the Trial Control rule. See below for examples.

Example 1

In this example, the trial starts in the early afternoon but the researcher wants to start video recording only after 6 PM (18:00) and end it after 12 hours. The box sequence is as follows (the rest of the Trial Control rule is not shown):

1.Start tracking.

2.Open Media Recorder. Add the Command line option /E.

3.Wait until 18:00.

4.Start video recording. Add the Command line option /R.

5.Wait 12 more hours.

6.Stop video recording. Add the Command line option /S.

inset_5000250.jpg 

Example 2

In this example, the researcher carries out live tracking during a 24-hour period. The trial starts during the light cycle when the animal is inside the shelter but the researcher wants to start recording video only when the animal leaves the shelter. This saves significant disk space as the resulting video will be shorter.

1.Create an External Command action to open MediaRecorder.

Select MRCmd.exe as the program to run and enter /E as a Command line option (see the figure below, box at the right).

2.Create an In Zone condition “Out of shelter”.

3.Create a Time condition to make sure that video recording starts when MediaRecorder is already open on the screen. Combine the two condition boxes with an operator of type All inputs true (see below for an example).

4.Create an External command similar to the first one, this time with /R as a Command line option to start recording.

5.You can have EthoVision stop video recording (Command line option: /S) after a specific time elapsed after the start.

In the example below, the first action box (left) starts up MediaRecorder. The action box on the right starts video recording when both conditions Out of Shelter and Time 5 sec become true, that is, the center-point of the animal has left the shelter at least 5 seconds after MediaRecorder was started.

inset_2800251.jpg 

Notes

To record video in MediaRecorder and carry out data acquisition in EthoVision XT simultaneously, you need to feed the video signal to two separate channels. Split the video cable that comes from the camera in two, and connect each end to a separate video input of the encoder board. Select one input per program, for example video input 1 for EthoVision XT and 3 for MediaRecorder.

inset_4400252.jpg 

There may be a delay between the command Start Recording and the moment MediaRecorder actually starts recording. Run a test recording to test how long this delay is.

See also

External commands